prepare("SELECT * FROM students WHERE id = ?"); $stmt->execute([$_SESSION['student_id']]); $student = $stmt->fetch(PDO::FETCH_ASSOC); // Get available exams with multiple subjects $stmt = $pdo->prepare(" SELECT e.*, COUNT(DISTINCT es.subject_id) as subject_count, GROUP_CONCAT(DISTINCT s.name SEPARATOR ', ') as subject_names FROM exams e LEFT JOIN exam_subjects es ON e.id = es.exam_id LEFT JOIN subjects s ON es.subject_id = s.id WHERE e.status = 'active' GROUP BY e.id ORDER BY e.year DESC, e.name "); $stmt->execute(); $exams = $stmt->fetchAll(PDO::FETCH_ASSOC); // Get recent results $stmt = $pdo->prepare(" SELECT r.*, e.name as exam_name, e.year, e.min_subjects, e.max_subjects FROM results r JOIN exam_sessions es ON r.session_id = es.id JOIN exams e ON es.exam_id = e.id WHERE es.student_id = ? ORDER BY r.submitted_at DESC LIMIT 5 "); $stmt->execute([$_SESSION['student_id']]); $recent_results = $stmt->fetchAll(PDO::FETCH_ASSOC); ?>
Registration Number:
Ready to ace your next exam? Choose from the available tests below.
You can choose to subjects for this exam
There are no active exams at the moment. Please check back later.
Percentage: %
Subjects Taken: of
Complete your first exam to see your results here!